﻿var app = angular.module("starter");

app.factory('sky.lyjt.accountService', [
     "$q", 
     "$rootScope", 
     "$http",
     "baseurl",
    function($q, $rootScope, $http, baseurl) {
        var loginUrl = baseurl + "api/Account";

        var login = function (username, password) {
            return $http({
                method: "POST",
                url: loginUrl,
                data: JSON.stringify({
                    usernameOrEmailAddress: username,
                    password: password
                })
            });
        };

        return {
            login: login
        };

    }]);